<?=$this->render('header.phtml') ?>

<?=$this->render('logo.phtml') ?>

<p class="about" id="goodpasswords">
<span class="closel"><a href="#" onclick="javascript:getElementById('goodpasswords').style.display = 'none'">[ Close ]</a></span>
<span class="atitle">What Makes a Good Password?</span><br />
It is very important that you choose a good password. You should avoid choosing one that contains only a single word that can be found
in a dictionary (or a combination of 2, 3, or 4 such words). It should not contain any names or dates of birth. It should not be easy
to guess. A good pasword is a random combination of upper and lower case letters, numbers, and special characters, such as @ ^ = $ * + etc.
We recommend choosing a password consisting of more than 20 characters (the longer the better).<br />
<span class="atitle">Good but Easy to Remember</span><br />
Here are some examples of passwords that are long, but easy to remember. You may use sentences, formulas, or combinations of all.<br />
 - Seventeen + 3hundred = 9<br />
 - You spelin is relly baad<br />
 - Or7ou2an6o2*zy(w1th)#
</p>

<h2>Sign-up for Free Account</h2>

<?php if (isset($this->success)): ?>
 <p class="notice"><?=$this->success ?></p>
 <p style="font-size: 2em; text-align: center; font-style: italic;"><a href="/" title="Login Now">Login Now</a></p>
<?php else: ?>

<p class="message" style="margin: 1em; font-style: italic; font-family: Arial; font-size: 0.9em;"><span style="font-weight: bold;">Disclaimer:</span> If you lose your password you will lose all data saved on this service. We at SoManyPasswords.com are not in any way, shape, or form liable for your experience in using this free service.</p>

<p style="margin: 0.5em; font-weight: bold;">Below you will need your API ID and API Key, both can be <a href="https://api.yubico.com/get-api-key/">obtained from Yubico.</a></p>

<?php if (isset($this->user_exists) && $this->user_exists == true): ?>
 <p class="strong_msg">The username you have entered below is already in use. Please try another.</p>
<?php endif; ?>

<?php if (is_array($this->message)): ?>
 <p class="strong_msg">One on more fields below are missing or contain invalid content.
 <?php if (is_array($this->message['username'])): ?>
  <br /> - You must supply a valid username.
 <?php endif; ?>
 <?php if (is_array($this->message['apiid'])): ?>
  <br /> - API ID can only contain digits.
 <?php endif; ?>
 <?php if (is_array($this->message['otp'])): ?>
  <br /> - OTP is not a valid Yubikey entry.
 <?php endif; ?>
 </p>
<?php endif; ?>

<form method="post" action="<?= $this->url(array(), 'signup') ?>">
	<p><label for="username">Username:</label> <input<?php if (is_array($this->message['username'])) echo ' style="border: 5px solid red;"'; ?> type="text" name="username" id="username" size="20"<?php if (isset($this->username)) echo ' value="' . $this->username . '"' ?> /></p>
	<p><label for="password">Password:</label> <input<?php if (is_array($this->message['password'])) echo ' style="border: 5px solid red;"'; ?> type="password" name="password" id="password" size="20"<?php if (isset($this->password)) echo ' value="' . $this->password . '"' ?> /> <a href="#" onclick="javascript:getElementById('goodpasswords').style.display = 'block'"><img src="/images/aid-16.png" alt="?"></a> <a href="#" style="font-style: italic; font-size: 0.9em;" onclick="javascript:getElementById('goodpasswords').style.display = 'block'">What's a good password?</a></p>
	<p><label for="apiid">API ID:</label> <input<?php if (is_array($this->message['apiid'])) echo ' style="border: 5px solid red;"'; ?> type="text" name="apiid" id="apiid" size="10"<?php if (isset($this->apiid)) echo ' value="' . $this->apiid . '"' ?> /> <a style="font-style: italic; font-size: 0.9em;" href="https://api.yubico.com/get-api-key/">Get it here</a></p>
	<p><label for="sigkey">API Key:</label> <input<?php if (is_array($this->message['sigkey'])) echo ' style="border: 5px solid red;"'; ?> type="text" name="sigkey" id="sigkey" size="30"<?php if (isset($this->sigkey)) echo ' value="' . $this->sigkey . '"' ?> /> <a style="font-style: italic; font-size: 0.9em;" href="https://api.yubico.com/get-api-key/">Get it here</a></p>
	<p><label for="otp">Yubikey OTP:</label> <input<?php if (is_array($this->message['otp'])) echo ' style="border: 5px solid red;"'; ?> type="text" name="otp" id="otp" size="35" /></p>
	
	<p style="margin-left: 8em;"><input type="submit" value="Add User" /></p>
</form>

<?php endif; ?>


<?=$this->render('footer.phtml') ?>
